package com.dream.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {
	
	public static Date converDate(String date){
		Date parse = null;
		try {
			SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
			parse = simpleDateFormat.parse(date);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return parse;
	}

	public static String converDateToString(Date date) {
		String format = null;
		try {
			SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
			 format = simpleDateFormat.format(date);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return format;
	}

}
